<?php
session_start();

define('SMARTY_DIR','lib/smarty/');
include(SMARTY_DIR.'Smarty.class.php');
include 'lib/bd.class.php';
include 'lib/Agenda.class.php';
include 'lib/Usuario.class.php';

$smarty = new Smarty();
$smarty->cache_dir   = "cache";
$smarty->config_dir  = "configs";
$smarty->template_dir = "templates";
$smarty->compile_dir = "templates_c";

if(!$_SESSION['logado'] and $_SERVER['SCRIPT_NAME']!='/SmartyProj/auth.php')
	header('location: /SmartyProj/auth.php');

$bd = new Bd('localhost','root','','php_agenda');
$bd->connect();
$agenda = new Agenda($bd,'agenda');
$usuario = new Usuario($bd);
?>